<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center scheduledetail_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub scheduledetail_fd0_0'>
          <view class='flex flex-wrap align-center scheduledetail_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  scheduledetail_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='scheduledetail_fd0_0_c1_c0'>预约列表</text>
          </view>
          <view class='flex flex-wrap align-center justify-end scheduledetail_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <!-- <view class="flex benben-flex-layout flex-wrap align-center home_flex_1">
        <swiper class="home_fd1_0_swiper" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
          <swiper-item class="swiper_item" v-for="(item,index) in bannerList" :key="index">
            <image class="home_fd1_0" :src="item.thumb" mode="aspectFill"></image>
          </swiper-item>
        </swiper>
      </view> -->

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout home_flex_2">
        <!-- <view class='flex flex-wrap align-center justify-between' @tap.stop="handleJumpDiy" data-type="navigateTo"
          :data-url="`/pages/grzx/subscribeList/subscribeList`">
          <view class='flex flex-wrap align-center'>
            <text>今日客户数</text>
            <text class='home_fd2_0_c0_c1'>{{user_count}}</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <text>查看更多 ></text>
          </view>
        </view> -->
        <view class='flex align-center flex-wrap home_fd2_1'>
          <view class='flex align-center justify-center '
            :class="timeId==item.value ? 'home_fd2_1_c0' : 'home_fd2_1_c1'" v-for="(item,index) in timeList"
            :key="index" @click.stop="chooseTime(item)">
            <text>{{item.name}} （{{item.count}}）</text>
            <image class='home_fd2_1_c0_c1' mode="aspectFit" v-if="timeId==item.value" :src='STATIC_URL+"168.png"'>
            </image>
          </view>
          <!-- <view class='flex flex-wrap align-center justify-center home_fd2_1_c1'>
            <text>10:30-13:00（2)</text>
          </view> -->
        </view>
        <!--   <view class='flex align-center'>
          <view class='flex flex-wrap align-center justify-center home_fd2_1_c0'>
            <text>10:30-13:00（2)</text>
            <image class='home_fd2_1_c0_c1' mode="aspectFit" :src='STATIC_URL+"168.png"'></image>
          </view>
          <view class='flex flex-wrap align-center justify-center home_fd2_1_c1'>
            <text>10:30-13:00（2)</text>
          </view>
        </view> -->
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <template v-for='(item,flex3) in dataList'>
        <view class="flex flex-direction align-stretch benben-flex-layout home_flex_3" :key='flex3'>
          <view class='flex flex-wrap align-center justify-between home_fd3_0'>
            <image class='home_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"151.png"'></image>
            <view class='flex flex-direction align-stretch flex-sub home_fd3_0_c1'>
              <view class='flex flex-wrap align-center home_fd3_0_c1'>
                <text>{{item.customerinfo_customer_name}}</text>
                <!-- <image class='home_fd3_0_c1_c0_c1' mode="aspectFit" :src='STATIC_URL+"155.png"'></image> -->
              </view>
              <view class='flex flex-wrap align-center home_fd3_0_c1_c1'>
                <text>{{item.customerinfo_customer_phone}}</text>
              </view>
            </view>
            <!-- <button class='home_fd3_0_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
              :data-url="`/pages/grzx/selectSales/selectSales?aid=${item.aid}`">移交</button> -->
          </view>
          <view class='flex flex-wrap align-end home_fd3_1'>
            <text class='home_fd3_1_c0'>{{item.customer_type_name}}日期</text>
            <text class="text-666">{{item.customerinfo_date_time}}</text>
          </view>
          <view class='flex flex-wrap align-end home_fd3_1'>
            <text class='home_fd3_1_c0'>预约日期</text>
            <text class="text-666">{{item.appointment_date}}</text>
          </view>
          <view class='flex flex-wrap align-center home_fd3_1'>
            <text class='home_fd3_1_c0'>预约时段</text>
            <text class='home_fd3_3_c1'>{{item.time_period_name}}</text>
          </view>
          <view class='flex flex-wrap align-end home_fd3_1' v-if="item.time_str">
            <text class='home_fd3_1_c0'>预约时间</text>
            <text class="text-666">{{item.time_str}}</text>
          </view>
          <view class='flex flex-wrap align-end home_fd3_1'>
            <text class='home_fd3_1_c0'>试衣间</text>
            <text class="text-666">{{item.fittingroom_name}}</text>
          </view>
          <view class='flex flex-wrap align-end home_fd3_1'>
            <text class='home_fd3_1_c0'>是否分配</text>
            <text class="text-weight-600" style="color:#996617">{{item.distribution_status_name}}</text>
          </view>
        </view>
      </template>
      <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
        :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      <!---flex布局flex布局结束-->
      <!-- <view class="flex flex-wrap align-center justify-center benben-position-layout flex home_flex_4"
        @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/grzx/addappointment/addappointment`">
        <text>添加
          预约</text>

      </view> -->
      <view :style="{height: '128rpx'}"></view>


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "dataList": [],
        bannerList: [],
        timeList: [],
        user_count: 0,
        timeId: "",
        riqi: ''
      };
    },
    computed: {
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {
      // if (global.appTabBarType) this.toHomeDiy()

      if (options.riqi) {
        this.riqi = options.riqi
      }

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      if (this.isLogin) {
        this.getData()
      } else {
        this.$urouter.reLaunch(`/pages/tabBar/loginPage/loginPage`);
      }
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      getListFunc() {
        this.minixPagingListsApi = global.apiUrls.post6698dd401865b;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          // user_type: '1'
          time_period: this.timeId,
          time: this.riqi
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },
      chooseTime(item) {
        this.timeId = item.value
        this.getListFunc()
      },
      getData() {
        this.$api.post(global.apiUrls.post641e624160dd0).then(res => {
          if (res.data.code == 1) {
            this.bannerList = res.data.data
          }
        })
        this.$api.post(global.apiUrls.post6698dc1398bd9, {
          time: this.riqi
        }).then(res => {
          if (res.data.code == 1) {
            this.timeList = res.data.data.time_period
            this.timeId = this.timeList[0].value
            this.getListFunc()
            this.user_count = res.data.data.user_count
          }
        })
      }

    }
  };
</script>
<style lang="scss" scoped>
  .scheduledetail_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .scheduledetail_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .scheduledetail_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .scheduledetail_fd0_0_c0 {
    width: 120rpx;
  }

  .scheduledetail_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 248, 238, 1);
    background-size: 100% auto;
  }

  .home_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .home_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .home_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .home_fd0_0_c0 {
    width: 120rpx;
  }

  .home_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .home_flex_1 {
    width: 750rpx;
    height: 510rpx;
  }

  .home_fd1_0_swiper {
    width: 750rpx;
    height: 510rpx;
  }

  .swiper_item {
    width: 750rpx;
    height: 510rpx;
  }

  .home_fd1_0 {
    width: 100%;
    height: 100%;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .home_flex_2 {
    background: rgba(255, 255, 255, 0.9);
    width: 686rpx;
    border-radius: 24rpx 24rpx 24rpx 24rpx;
    margin: 24rpx auto 0rpx auto;
    padding: 24rpx;
    position: relative;
    z-index: 9;
  }

  .home_fd2_1_c1 {
    background: rgba(248, 248, 248, 1);
    border-radius: 8rpx 8rpx 8rpx 8rpx;
    width: 300rpx;
    height: 56rpx;
    font-size: 24rpx;
    line-height: 56rpx;
    position: relative;
    margin: 12rpx 16rpx 12rpx 0rpx;
  }

  .home_fd2_1_c0_c1 {
    width: 31rpx;
    height: 33rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    position: absolute;
    top: 0rpx;
    right: 0rpx;
  }

  .home_fd2_1_c0 {
    background: #FCEACE;
    border-radius: 8rpx 8rpx 8rpx 8rpx;
    width: 300rpx;
    height: 56rpx;
    font-size: 24rpx;
    line-height: 56rpx;
    position: relative;
    margin: 12rpx 16rpx 12rpx 0rpx;
  }

  .home_fd2_1 {
    width: 640rpx;
    margin: 8rpx 0rpx 16rpx 0rpx;
  }

  .home_fd2_0_c0_c1 {
    font-size: 36rpx;
    font-weight: 600;
    color: rgba(211, 152, 80, 1);
    margin: 0rpx 0rpx 0rpx 24rpx;
    transform: translateY(4rpx);
  }

  .home_flex_3 {
    background: rgba(255, 255, 255, 1);
    margin: 26rpx 24rpx 0rpx 24rpx;
    padding: 24rpx;
    border-radius: 26rpx;
    background-size: 100% auto;
  }

  .home_fd3_6_c1_c1 {
    margin: 0rpx 32rpx 0rpx 24rpx;
  }

  .home_fd3_6_c1_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 100rpx;
  }

  .home_fd3_3_c1 {
    background: rgba(255, 248, 238, 1);
    background-size: 100% auto;
    border-radius: 8rpx;
    padding: 8rpx 8rpx 8rpx 8rpx;
    color: #666666;
  }

  .home_fd3_1_c0 {
    color: rgba(170, 170, 170, 1);
    width: 150rpx;
  }

  .home_fd3_1 {
    padding: 24rpx 0rpx 0rpx 0rpx;
    font-size: 28rpx;
  }

  .home_fd3_0_c2 {
    background: #F9E4C3;
    border-radius: 8rpx 8rpx 8rpx 8rpx;
    width: 136rpx;
    line-height: 60rpx;
    font-size: 24rpx;
    color: var(--benbenFontColor0);
    height: 56rpx;
  }

  .home_fd3_0_c1_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .home_fd3_0_c1_c0_c1 {
    width: 115rpx;
    height: 34rpx;
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .home_fd3_0_c1 {
    font-size: 32rpx;
    font-weight: 600;
  }

  .home_fd3_0_c0 {
    width: 62rpx;
    height: 67rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .home_fd3_0 {
    border-bottom: 1px solid #eee;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .home_flex_4 {
    background: #FFFFFF;
    width: 128rpx;
    height: 128rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(100rpx + var(--window-bottom));
    right: 32rpx;
    border-radius: 100rpx;
    box-shadow: 0rpx 3rpx 15rpx 1rpx rgba(223, 188, 134, 0.51);
  }
</style>
